package cn.laixueit.service.impl;

import cn.laixueit.mapper.SpecParamMapper;
import cn.laixueit.pojo.item.SpecParam;
import cn.laixueit.service.SpecParamService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.HashMap;

@Service
public class SpecParamServiceImpl extends ServiceImpl<SpecParamMapper, SpecParam> implements SpecParamService {
    @Override
    public Collection<SpecParam> findList(Long gid,Long cid,Boolean searching,Boolean generic) {
        HashMap<String, Object> map = new HashMap<>();
        if(gid!=null){
            map.put("group_id",gid);
        }
        if(cid!=null){
            map.put("cid",cid);
        }
        if(searching!=null){
            map.put("searching",searching);
        }
        map.put("generic",generic);
        Collection<SpecParam> specParams = listByMap(map);
        return specParams;
    }
}
